<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/login.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    
    <ui:define name="main_menu">
        <f:view beforePhase="#{indexManagedBean.initView}" ></f:view>
        <p:menubar model="#{indexManagedBean.touristMainMenuModel}" styleClass="main_menu"/>
    </ui:define>

    <ui:define name="content">

        <!-- panel for dividing web page into sections -->
        <p:panel id="panel" header="#{bundle['login.tourist.panel']}" style="margin-bottom:10px;">  
            <p:messages id="statusMessages" />
            
            <h:panelGrid columns="3" cellpadding="5">
                <h:outputText id="touristLoginUsernameLabel" value ="#{bundle['login.username.label']}" />
                <h:inputText id="username" required="true" label="username" requiredMessage="#{bundle['login.username.required']}" value="#{touristLoginManagedBean.username}" />
                <p:message for="username"/>

                <h:outputLabel id="touristLoginPasswordLabel" value="#{bundle['login.password.label']}" />
                <p:password id="password" feedback="false" minLength="6" required="true" label="password" requiredMessage="#{bundle['login.password.required']}" value="#{touristLoginManagedBean.password}" />
                <p:message for="password"/>
            </h:panelGrid>
            <br/>
            <h:panelGrid columns="1">
                <h:column>
                    <h:selectBooleanCheckbox id="remember_me"/> <h:outputLabel id="remember" value="#{bundle['rememberme.label']}"/>
                </h:column>
                <h:commandLink id="forgot_password" value ="#{bundle['forgotpassword.label']}" action="#{pageRedirectorBean.goTouristForgotPassword}" immediate="true"/>
            </h:panelGrid>
            <br/>
            <p:commandButton id="loginLoginButton" value="#{bundle['login.login.button']}" update="panel" actionListener="#{touristLoginManagedBean.doLogin}"/>
        </p:panel>    
    </ui:define>  
</ui:composition>

